package com.model;

// Generated 15 f�vr. 2013 15:56:26 by Hibernate Tools 4.0.0

import java.util.Date;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * TermeDeService generated by hbm2java
 */
@Entity
@Table(name = "TermeDeService", schema = "dbo", catalog = "CRM")
public class TermeDeService implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private TermeDeServiceId id;
	private Contrat contrat;
	private ElementContrat elementContrat;
	private Date dateCreation;
	private String etat;

	public TermeDeService() {
	}

	public TermeDeService(TermeDeServiceId id, Contrat contrat,
			ElementContrat elementContrat) {
		this.id = id;
		this.contrat = contrat;
		this.elementContrat = elementContrat;
	}

	public TermeDeService(TermeDeServiceId id, Contrat contrat,
			ElementContrat elementContrat, Date dateCreation, String etat) {
		this.id = id;
		this.contrat = contrat;
		this.elementContrat = elementContrat;
		this.dateCreation = dateCreation;
		this.etat = etat;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "contratId", column = @Column(name = "contratId", nullable = false)),
			@AttributeOverride(name = "elementContratId", column = @Column(name = "ElementContratId", nullable = false)) })
	public TermeDeServiceId getId() {
		return this.id;
	}

	public void setId(TermeDeServiceId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "contratId", nullable = false, insertable = false, updatable = false)
	public Contrat getContrat() {
		return this.contrat;
	}

	public void setContrat(Contrat contrat) {
		this.contrat = contrat;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ElementContratId", nullable = false, insertable = false, updatable = false)
	public ElementContrat getElementContrat() {
		return this.elementContrat;
	}

	public void setElementContrat(ElementContrat elementContrat) {
		this.elementContrat = elementContrat;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "DateCreation", length = 23)
	public Date getDateCreation() {
		return this.dateCreation;
	}

	public void setDateCreation(Date dateCreation) {
		this.dateCreation = dateCreation;
	}

	@Column(name = "Etat", length = 10)
	public String getEtat() {
		return this.etat;
	}

	public void setEtat(String etat) {
		this.etat = etat;
	}

}
